<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div class="page" >
    <div class="page-container">
        <h3>
            我的收获地址
        </h3>
        <table class="shop_table">
            <thead>
            <tr>
                <th class="order-number"><span>姓名</span></th>
                <th class="order-date"><span>手机号</span></th>
                <th class="order-total"><span>详细地址</span></th>
                <th class="order-total"><span>是否是默认地址</span></th>
                <th class="amount"><span>操作</span></th>
                <th class="order-actions"></th>
            </tr>
            </thead>
            <script id="addressScript" type="text/html">
                {{if data.length==0}}
                <tr>
                    <td colspan="5">暂无地址数据</td>
                </tr>
                {{/if}}
                {{each data item index}}
                <tr>
                    <td class="order-number"><a href="#">{{item.name}}</a></td>
                    <td class="order-date">{{item.phone}}</td>
                    <td class="order-total">{{item.detailAddress}}</td>
                    <td class="amount">{{item.defaultAddress | defaultAddressFlag}}</td>
                    <td class="order-actions">
                        <a href="#" class="button">设为默认</a>
                    </td>

                </tr>
                {{/each}}
            </script>
            <tbody id="address">


            </tbody>
        </table>

    </div>
</div>
<script src="js/jquery-1.8.3.min.js"></script>
<script src="js/moment-2.2.1.js"></script>
<script src="js/template-web.js"></script>
<script src="js/jdgj/config.js"></script>
<script>
    var userId = config.getUserId();
    // 个人资料
    // 地址列表
    template.defaults.imports.defaultAddressFlag = function(value){
        return config.defaultAddressFlag(value);
    };
    var addressPageNo = addressPageNo | 1;
    $.get(config.baseUrl+"/address/listAddress.json", {userId: userId, pageNo:addressPageNo }, function(result){
        var html = template("addressScript", result);

        $("#address").html(html);
    });
</script>
</body>
</html>